(function () {
    angular.module('app')
        .factory('PersonInfoFactory',fn);

    //var localPersonInfo = {};
    function fn(urlCnst,mockHttp) {
        var self = {};

        self.getInfo = function ( body ,cb){
            if( !urlCnst['mockHttp'] ){
                urlCnst.get('somepath', body,cb);
                return;
            }
            return cb(mockHttp.getResponse());
            //return cb( { msg:'', res:localPersonInfo, err:0});
        }
        self.putInfo = function (body , cb ){
            if( !urlCnst['mockHttp'] ){
                urlCnst.post('somepath', body, cb);
            }
            localPersonInfo = body;
            return cb( {msg:'', res:body, err:0 } );
        }
        return self;
    }
})();
